package com.nuaa.shopping.dao.impl;

import com.nuaa.shopping.dao.OrderDao;
import com.nuaa.shopping.entity.Order;
import com.nuaa.shopping.util.JdbcTemplate;

public class OrderDaoImpl implements OrderDao{

	@Override
	public void insert(Order order) {
		String sql = new StringBuffer()
			.append(" insert into t_order ")
			.append(" 	(user_id,no,price,createdate) ")
			.append(" values ")
			.append(" 	(?,?,?,?) ")
			.toString();
		int id = JdbcTemplate.save(sql, order.getUser().getId(),order.getNo(),order.getPrice(),order.getCreateDate());
		order.setId(id);
	}

}
